package com.class06;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import java.io.IOException;

@WebServlet("/servletC")
public class ServletC extends HttpServlet {
    //    4、转发静态资源：需要注意必须放在web目录下，否则会报404
//    5、如果静态资源在WEB-INF目录下，需要加上前缀"WEB-INF/"
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        req.getRequestDispatcher("WEB-INF/bbbb.html").forward(req,resp);
//        6、准发不能访问外部的资源
//        req.getRequestDispatcher("https://www.baidu.com").forward(req, resp);

    }
}
